import request from '@/config/axios'

// 死淘 VO
export interface DeadVO {
  id: number // id
  houseId: number // 农舍
  deadNum: number // 死亡数量
  eliminateNum: number // 淘汰数量
  description: string // 描述
  status: number // 状态
  houseName:string//农舍名称
}

// 死淘 API
export const DeadApi = {
  // 查询死淘分页
  getDeadPage: async (params: any) => {
    return await request.get({ url: `/farm/dead/page`, params })
  },

  // 查询死淘详情
  getDead: async (id: number) => {
    return await request.get({ url: `/farm/dead/get?id=` + id })
  },

  // 新增死淘
  createDead: async (data: DeadVO) => {
    return await request.post({ url: `/farm/dead/create`, data })
  },

  // 修改死淘
  updateDead: async (data: DeadVO) => {
    return await request.put({ url: `/farm/dead/update`, data })
  },

  // 删除死淘
  deleteDead: async (id: number) => {
    return await request.delete({ url: `/farm/dead/delete?id=` + id })
  },

  // 导出死淘 Excel
  exportDead: async (params) => {
    return await request.download({ url: `/farm/dead/export-excel`, params })
  },

  // 下载死淘导入模板=
  importDeadTemplate:async() => {
    return request.download({
      url: '/farm/dead/get-import-template' 
    })
  }
}
